package com.stgl.util;


import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;

import java.io.IOException;



public class HttpClientUtil {
	
	  
	public static String sendGet(String url) {
		
		   String html = ""; 
		   HttpClient client = new HttpClient();
		   GetMethod get = new GetMethod(url);
		   HttpMethodParams params = new HttpMethodParams();
		   //params.setParameter("UserID", "99999005");
		   //params.setParameter("Action", "Login");
		   get.setParams(params);
	   try {
			int statusCode = client.executeMethod(get);
			if(statusCode == 200)
			{
				html = get.getResponseBodyAsString();
			}
			get.releaseConnection(); 
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} 
	    return html;
		 
	} 
	
	
}
